extends layout

block content
    h1= title
    p #[strong Author]
        a(href=book.author.url) #{book.author.name}
    p #[strong Summary:] #{book.summary}
    p #[strong ISBN:] #{book.isbn}
    p #[strong Genre] &nbsp;
        each val,index in book.genre
            a(href=val.url) #{val.name}
             if index<book.genre.length-1
                |,
    div(style='margin-left:20px;margin-top:20px')
        if book_instances.length>0
            h4 须先删除下列图书实例后，才能删除当前书目
            each val in book_instances
                hr
                if val.status === '可供借阅'
                    p.text-success #{val.status}
                else if val.status === '馆藏维护'
                    p.text-danger #{val.status}
                else
                    p.text-warning #{val.status}

                if val.status !== '可供借阅'
                    p #[strong 归还日期：] #{val.due_back_formatted}
                p #[strong Id:] &nbsp;
                    a(href=val.url) #{val._id}
        else
            form(method='post' action='')
                button.btn.btn-primary(type='submit') 确定删除

